import React from 'react';
import { useRouteError, Outlet } from 'react-router-dom';
import { Button } from 'antd';
import Test2 from '@/pages/Test2';
import Test1 from '@/pages/Text1';

export type RouteField = {
  path?: string;
  component?: any;
  children?: RouteField[];
  keepAlive?: boolean;
  animation?: boolean;
  element?: any;
  errorElement?: any;
  [a: string]: any;
};

const NotFund = () => {
  return <div>找不到路径</div>;
};

// export const routes = [];
export const routes: RouteField[] = [
  {
    path: '/',
    component: (
      <div>
        <Outlet />
      </div>
    ),
    children: [
      {
        path: '/test1',
        component: Test1,
      },
      {
        path: '/test2',
        component: Test2,
      },
    ],
  },
  {
    path: '*',
    component: NotFund,
  },
];
